//------------------------------------------------------------------------------
///	\file event_log.h
///
///	\brief
///	Event log header file
///
///	This is a simple event logging mechanism that can be used
///	to track the progress of an algorithm.
///
//	$Id: event_log.h 350 2015-02-26 18:25:37Z ac.verbeck@gmail.com $
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//	The MIT License (MIT)
//
//	Copyright (c) 2015 A.C. Verbeck
//
//	Permission is hereby granted, free of charge, to any person obtaining a copy
//	of this software and associated documentation files (the "Software"), to deal
//	in the Software without restriction, including without limitation the rights
//	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//	copies of the Software, and to permit persons to whom the Software is
//	furnished to do so, subject to the following conditions:
//
//	The above copyright notice and this permission notice shall be included in
//	all copies or substantial portions of the Software.

//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//	THE SOFTWARE.
//------------------------------------------------------------------------------

#define	EVENT_LOG_SZ	128														//	Number of events to be tracked

//------------------------------------------------------------------------------
//	Event log enums:
//	These are the events to be tracked
//------------------------------------------------------------------------------
enum {
	INT_I2C_S1			= 0x11,
	INT_I2C_S2			= 0x12,
	INT_I2C_DATA		= 0x13,
	INT_I2C_DONE		= 0x14,
	INT_DMA_DONE		= 0x15
};
enum {
	I2C_CMD_ENABLE		= 0x20,
	I2C_CMD_GET_STATE	= 0x21,
	I2C_CMD_RESET		= 0x22,
	I2C_CMD_GET_LEN		= 0x23,
	I2C_CMD_GET_DATA	= 0x24,
	I2C_CMD_WHO_AM_I	= 0x25,
};
enum {
	EV_QUEUE_BUFFER		= 0x30,
	EV_DMA_CFG			= 0x31,
	EV_CMD_PROC			= 0x32,
	EV_END_LOG			= 0x33,
};


//------------------------------------------------------------------------------
//	Event log functions:
//	- EventLog_init(void)
//	- EventLog_log(event)
//	- EventLog_dump(void)
//------------------------------------------------------------------------------
void	EventLog_init(void);
void	EventLog_log(uint8_t ev);
void	EventLog_dump(void);

//
//	End event_log.h
//
